#ifndef __DS1302__
#define __DS1302__

#define SECWR 0x80
#define MINWR 0x82
#define HOURWR 0x84
#define DATEWR 0x86
#define MONWR 0x88
#define DAYWR 0x8A
#define YEARWR 0x8C
#define WP 0x8E

//{24,11,14,21,20,31,4};
#define YEAR_IDX 0
#define MON_IDX 1
#define DATE_IDX 2
#define HOUR_IDX 3
#define MIN_IDX 4
#define SEC_IDX 5

#define DAY_IDX 6

extern unsigned char time[];
extern unsigned char time_cmd[];

void DS1302_Init();
void DS1302_WriteByte(unsigned char cmd,unsigned char Data);
unsigned char DS1302_ReadByte(unsigned char cmd);

void Write_Time();
void Read_Time();

#endif